<template>
  <dt-modal-edit ref='edit' :title='title' :label-width='130' :width='800' @ok='onOk'>
  </dt-modal-edit>
</template>

<script>
  import auditOpt from '../opt/audit.js'
  import ruleMgr from '@/biz/commission/rule.js'
  
  export default {
    data() {
      return {
        info: {},
        title: '佣金规则审核'
      }
    },
    mounted() {
    },
    methods: {
      show(info) {
        this.info = {
          ...info,
          type: null,
          auditContent: null
        }
        this.$refs.edit.show(auditOpt.options(this, 2), this.info)
      },
      hide() {
        this.$refs.edit.hide()
      },
      update() {
        this.$refs.edit.update(auditOpt.options(this, 2))
      },
      onOk() {
        ruleMgr.audit(this.info.ruleId, this.info.type, this.info.auditContent).then(res => {
          this.$emit('success')
          this.hide()
        })
      }
    }
  }
</script>

<style>
</style>
